<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
	<title>ZeroClipboard（复制功能）</title>
</head>
<body>
	<label for="cardid">卡号：</label>
	<input type="text" name="cardid" id="cardid" value="123456789" />
	<button id="copycardid">点击复制卡号</button>
</body>
</html>
<script type="text/javascript" src="jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="ZeroClipboard.min.js"></script>
<script type="text/javascript">
$(function(){
	function init() {
		var clip = new ZeroClipboard($("#copycardid"),{
			moviePath: "/bootstrapDemo/webFrame/ZeroClipboard/ZeroClipboard.swf",
			trustedDomains: ['*']
		});
		
		clip.on('datarequested', function(client) {
			client.setText($("#cardid").val());
		});

		clip.on('complete', function(client, args) {
			alert('复制成功');
		});

		clip.on('wrongflash noflash', function() {
			ZeroClipboard.destroy();
		});
		
		console.info(clip);
		
	}
	
	init();
});

</script>